Skip to content

refactor(opam): share modern build command generation - #15550

Open
rgrinberg wants to merge 1 commit into
ocaml:mainfrom
rgrinberg:push-rwtxrokmxnyp
Open

refactor(opam): share modern build command generation#15550
rgrinberg wants to merge 1 commit into
ocaml:mainfrom
rgrinberg:push-rwtxrokmxnyp

Conversation

@rgrinberg

Copy link
Copy Markdown
Member

Parameterize the Dune 3 build command template by its runtest alias instead of maintaining separate templates for package-local runtest aliases.

Parameterize the Dune 3 build command template by its runtest alias instead of maintaining separate templates for package-local runtest aliases.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors opam build: command generation for Dune 3.x by parameterizing the modern build-command template with a configurable runtest alias (to avoid maintaining separate templates for package-local runtest aliases).

Changes:

  • Consolidate the Dune ≥ 3.0 build-command generator to accept a ~runtest argument.
  • Update version/exclusive_dir branching to pass either @runtest or @runtest/<dir> into the shared generator.
  • Remove the need for a separate Dune 3.23+ template by reusing the parameterized one.

Comment on lines +65 to 68
and from_3_0 ~with_subst ~with_sites ~runtest =
let subst = if with_subst then {| [ "dune" "subst" ] {dev} |} else "" in
let promote_install_files =
if with_sites then {| "--promote-install-files=false" |} else ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants